package org.madgecko.basic.service.impl;

import org.madgecko.basic.model.Pager;
import org.madgecko.basic.dao.iface.IUserDao;
import org.madgecko.basic.model.User;
import org.madgecko.basic.service.iface.IUserService;
import org.springframework.stereotype.Service;

import javax.inject.Inject;

@Service
public class UserService implements IUserService {

	@Inject
	private IUserDao userDao;

	@Override
	public void add(User user) {
		userDao.add(user);
	}

	@Override
	public void delete(Integer id) {
		//TODO 删除用户关联的内容
		userDao.delete(id);
	}

	@Override
	public void update(User user) {
		userDao.update(user);
	}

	@Override
	public User load(Integer id) {
		return userDao.load(id);
	}

	@Override
	public Pager<User> findUserByCon(Integer status, String con) {
		return userDao.findUserByCon(status, con);
	}

	@Override
	public User loadByName(String name){
		return userDao.loadByName(name);
	}
}
